<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        {{msg}}
        <!-- <div v-if="show">展示</div>
        <div v-else>不展示</div> -->
        <!-- <div v-show="show">v-show</div> -->
        <!-- <p v-for="(value,index) in arr">{{value}} -- {{index}}</p> -->
        <!-- <div v-for="(value,key,index) in obj">{{value}} -- {{key}} -- {{index}}</div> -->
        <!-- <p v-for="(value) in objArr">{{value.name}} - {{value.age}}</p> -->
        <!-- v-on:click 可以简写成 @click -->
        <!-- <button v-on:click="add()">加1</button> -->
        <!-- <div>{{count}}</div> -->
        <!-- v-bink:style 可以简写成 :style -->
        <!-- <div style="width: 100px;height: 100px;border: 1px solid #000;" v-bind:style="bgcolor"></div> -->
        <input type="text" v-model="text">
        <button @click="showText()">打印</button>
    </div>
    <script src="./vue.js"></script>

    <script>
        new Vue({
            el:'#app',
            data:{
                msg:'Hello world123',
                show:true,
                show2:false,
                arr:['sdf','sdfkjl','423423kjlj'],
                obj:{
                    name:"zhangsan",
                    age:18,
                    sex:'男'
                },
                objArr:[
                {
                    name:"zhangsan",
                    age:18,
                    sex:'男'
                },
                {
                    name:"zhangsan",
                    age:19,
                    sex:'男'
                },
                {
                    name:"zhangsan",
                    age:20,
                    sex:'男'
                },
                ],
                count:1,
                bgcolor:{
                    backgroundColor:"#ccc"
                },
                text:'123'
            },
            methods:{
                add(){
                    this.count++
                },
                showText(){
                    console.log(this.text)
                    this.text='lskdjf'
                }
            },
            created(){
                console.log("加载完成")
            }
        })
    </script>
</body>
</html>